import axios from './axios';

const jobUrl = 'jobIntertion'; // 个人求职意向

export default {
  // 创建个人求职意向
  postJob(obj) {
    const postObj = {
      citys: obj.city.join(','),
      industry: obj.industry.join(','),
      position: obj.position.join(','),
      salary: obj.salary,
      scale: obj.scale,
      ensure: obj.ensure,
    };
    return axios.post(`${jobUrl}`, postObj);
  },
  // 编辑求职意向
  putUser(obj) {
    const postObj = {
      id: obj.id,
      citys: obj.city.join(','),
      industry: obj.industry.join(','),
      position: obj.position.join(','),
      salary: obj.salary,
      scale: obj.scale,
      ensure: obj.ensure,
    };
    return axios.put(`${jobUrl}`, postObj);
  },
  // 求职意向列表
  getJobList() {
    return axios.get(`${jobUrl}`);
  },
  // 删除个人基础信息
  delJob(id) {
    return axios.delete(`${jobUrl}?id=${id}`);
  },
};
